/*
 * @Author       : huangzb
 * @Date         : 2024-01-25 20:01:08
 * @LastEditors: guangyunl
 * @LastEditTime: 2024-04-06 04:06:31
 * @Description  : file content
 * @FilePath     : \PcBackend\src\views\OrdersManage\config.js
 */
const validatePass = (rule, value, callback) => {
    const _rule = /^[0-9]*(\.[0-9]{1,2})?$/;
    if (!_rule.test(value)) {
        callback(new Error("请输入数字"));
    } else {
        callback();
    }
};

const Main_Option = {
    headerAlign: "center",
    align: "center",
    border: true,
    index: true,
    menuWidth: 200,
    addBtn: false,
    // delBtn: false,
    editBtnIcon: " ",
    delBtnIcon: " ",
    // dialogMenuPosition: 'center',
    // defaultExpandAll:true,
    column: [
        {
            label: "用户账号",
            prop: "userName",
            bind: "user.userName",
            search: true,
            disabled: true,
        },
        {
            label: "订单编号",
            prop: "id",
            search: true,
            disabled: true,
        },
        {
            label: "总额/¥",
            prop: "totals",
            disabled: true,
            rules: [
                {
                    required: true,
                    validator: validatePass,
                    trigger: ["blur", "change"],
                },
            ],
        },
        {
            label: "状态",
            prop: "status",
            type: "select",
            search: true,
            dicData: [
               
                {
                    label: "待支付",
                    value: 0,
                },
                {
                    label: "已支付",
                    value: 1,
                },
                {
                    label: "待发货",
                    value: 2,
                },
                {
                    label: "已发货",
                    value: 3,
                },
                {
                    label: "退款中",
                    value: 4,
                },
                {
                    label: "已退款",
                    value: 5,
                },
                {
                    label: "已完成",
                    value: 6,
                },
                {
                    label: "已取消",
                    value: 7,
                },
            ],
            rules: [
                {
                    required: true,
                    message: "请选择 类型",
                    trigger: "blur",
                },
            ],
        },
        {
            label: "新建时间",
            prop: "createdAt",
            display: false,
        },
        {
            label: "最后更新时间",
            prop: "updatedAt",
            display: false,
        },
    ],
};

const Main_Data = [];

const orderDirt = [   
    {
        label: "待支付",
        value: 0,
    },
    {
        label: "已支付",
        value: 1,
    },
    {
        label: "待发货",
        value: 2,
    },
    {
        label: "已发货",
        value: 3,
    },
    {
        label: "退款中",
        value: 4,
    },
    {
        label: "已退款",
        value: 5,
    },
    {
        label: "已完成",
        value: 6,
    },
    {
        label: "已取消",
        value: 7,
    },
];
const orderInfo = [{
    label: "订单总额",
    value: "totals",
},
{
    label: "优惠金额",
    value: "coupon_totals",
},
{
    label: "订单状态",
    value: "statusDecs",
},{
    label: "订单备注",
    value: "remark",
}]

const customerInfo = [
    {
        label: "昵称",
        value: "nickName",
    },
    {
        label: "账号",
        value: "userName",
    },
    // {
    //   label: "余额",
    //   value: "totals",
    // },
]

const addressInfo = [
    {
        label: "收货人",
        value: "nickName",
    }, {
        label: "手机号",
        value: "mobile",
    },
    {
        label: "收货地址",
        value: "receiveAddress",
    }
]

const shopListInfo = []
export { Main_Option, Main_Data, customerInfo, addressInfo, shopListInfo, orderDirt, orderInfo };
